| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Program.h
1 // Program.h
3 //
5
6 namespace nkGraphics
7 {
13 class Program : public Resource, public nkExport::Exportable
14 {
15 public :
16
24 Program (System* system) noexcept ;
28 virtual ~Program () ;
29
33 const ProgramCompilationResult& getLastCompilationResult () const ;
37 bool isFromFile () const ;
41 bool isFromMemory () const ;
45 const ProgramSourcesHolder& getMemory () const ;
49 nkMemory::BufferView<const ProgramSemanticEntry> getInputSemantics () const ;
53 unsigned int getId () const ;
57 PROGRAM_TYPE getType () const ;
61 PROGRAM_COMPILATION_PROFILE getProfile () const ;
62
74 virtual void setFromMemory (const ProgramSourcesHolder& memory) ;
81 virtual void setDefines (const ProgramSourcesHolder& memory) ;
101 void setFromFiles (nkMemory::StringView folder) ;
108 void setFileExtensions (nkMemory::StringView value) ;
114 void setId (unsigned int id) ;
125 void setProfile (PROGRAM_COMPILATION_PROFILE profile) ;
199 void setActivateCrossCompilerDefines (bool value) ;
200
206 bool prepareMemoryWithFiles () ;
212 virtual bool loadFromMemory () = 0 ;
220 virtual bool tryToLoadFrom (ProgramSourcesHolder& newMemory) = 0 ;
221
251 virtual bool load () override ;
255 virtual void unload () override ;
256
257 // Import / Export
258 virtual void exportClassToTree (nkExport::Node* rootNode) override ;
259 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
260
261 public :
262
263 // Statics
271 static nkMemory::UniquePtr<Program> create (System* system = nullptr) ;
272 } ;
273 }
nkGraphics::Program
Holds all informations related to GPU programs, and manages their compilation.
Definition: Program.h:14
nkGraphics::Program::getMemory
const ProgramSourcesHolder & getMemory() const
nkGraphics::Program::loadFromMemory
virtual bool loadFromMemory()=0
nkGraphics::System
Main interface with the component system.
Definition: System.h:14
nkGraphics::Program::getId
unsigned int getId() const
nkGraphics::Program::setActivateCrossCompilerDefines
void setActivateCrossCompilerDefines(bool value)
nkGraphics::Program::setFromFiles
void setFromFiles(nkMemory::StringView folder)
nkExport::Exportable
An interface to define objects that can be exported using this component.
Definition: Exportable.h:15
nkMemory::BufferView
A view over data.
Definition: BufferView.h:18
nkGraphics::Program::prepareMemoryWithFiles
bool prepareMemoryWithFiles()
nkGraphics::PROGRAM_TYPE
PROGRAM_TYPE
The type of programs available.
Definition: ProgramType.h:12
nkGraphics::Program::~Program
virtual ~Program()
nkGraphics::Program::unload
virtual void unload() override
nkGraphics::Program::setDefines
virtual void setDefines(const ProgramSourcesHolder &memory)
nkGraphics::Program::tryToLoadFrom
virtual bool tryToLoadFrom(ProgramSourcesHolder &newMemory)=0
nkGraphics::ProgramCompilationResult
Holds information about a complation result, from a program.
Definition: ProgramCompilationResult.h:12
nkGraphics::Program::setId
void setId(unsigned int id)
nkGraphics::Program::getType
PROGRAM_TYPE getType() const
nkGraphics::Program::getLastCompilationResult
const ProgramCompilationResult & getLastCompilationResult() const
nkGraphics::Program::getInputSemantics
nkMemory::BufferView< const ProgramSemanticEntry > getInputSemantics() const
nkGraphics::Program::setFileExtensions
void setFileExtensions(nkMemory::StringView value)
nkGraphics::Program::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::Program::isFromMemory
bool isFromMemory() const
nkGraphics::Program::Program
Program(System *system) noexcept
nkGraphics::Program::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkGraphics::Program::create
static nkMemory::UniquePtr< Program > create(System *system=nullptr)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkGraphics::ProgramSourcesHolder
Holds the sources of a program.
Definition: ProgramSourcesHolder.h:26
nkGraphics::Program::isFromFile
bool isFromFile() const
nkGraphics::Resource
Base class for a resource in the component.
Definition: Resource.h:12
nkGraphics::Program::setFromMemory
virtual void setFromMemory(const ProgramSourcesHolder &memory)
nkGraphics::Program::load
virtual bool load() override
nkGraphics::PROGRAM_COMPILATION_PROFILE
PROGRAM_COMPILATION_PROFILE
Available program compilation profiles.
Definition: DxDefinesWrapper.h:460
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::Program::getProfile
PROGRAM_COMPILATION_PROFILE getProfile() const
nkGraphics::Program::setProfile
void setProfile(PROGRAM_COMPILATION_PROFILE profile)